import React, { Component } from 'react'

export class Son extends Component {
    sonBtn = (arr) =>{
        // console.log("sonBtn",arr);
        this.props.parentState(arr)
    }
    render() {
        let {my_arr} = this.props
        console.log(this);
        return (
            <div>
                {
                    my_arr.map((item,index)=>{
                        return <p key={index}>{item}</p>
                    })
                }
    
                <button onClick={()=>this.sonBtn([6,7,8,9,10])}>子传父</button>
            </div>
        )
    }
}

export default Son

// this.sonBtn([6,7,8,9,10])